﻿package component.tree.model;

import java.util.HashMap;
import java.util.Map;

import component.tree.util.ConfigUtil;
import component.tree.util.TreeUtil;

public class TreeModelFactory {
	private static Map treeModelMap = new HashMap();
	
	public static TreeModel getTreeModel(String id){
		Object obj = treeModelMap.get(id);
		if(obj == null){
			String treeModelClassName = ConfigUtil.getTreeModel(id);
			
			obj = TreeUtil.getObject(treeModelClassName);
			treeModelMap.put(id, obj);
		}
		
		return (TreeModel)obj;
	}
}
